#ifndef Mac27d00df45641c195836b846b6e26f1
#define Mac27d00df45641c195836b846b6e26f1

/**
 *   Copyright (c) Rich Hickey. All rights reserved.
 *   The use and distribution terms for this software are covered by the
 *   Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
 *   which can be found in the file epl-v10.html at the root of this distribution.
 *   By using this software in any fashion, you are agreeing to be bound by
 * 	 the terms of this license.
 *   You must not remove this notice, or any other, from this software.
 **/

/**
 *   Author: Timothy Baldridge
 **/
#include "ILookup.h"
#include "IPersistentCollection.h"
#include "Ref.h"


namespace clojure_lang
{
    class CjObject;
    class IMapEntry;
    /// <summary>
    /// Represents an immutable key/value mapping.
    /// </summary>
    class IAssociative: virtual public IPersistentCollection, virtual public ILookup
    {
	public:
        /// <summary>
        /// Test if the map contains a key.
        /// </summary>
        /// <param name="key">The key to test for membership</param>
        /// <returns>True if the key is in this map.</returns>
        bool containsKey(CjObject *key);

        /// <summary>
        /// Returns the key/value pair for this key.
        /// </summary>
        /// <param name="key">The key to retrieve</param>
        /// <returns>The key/value pair for the key, or null if the key is not in the map.</returns>
        virtual IMapEntry *entryAt(CjObject *key) = 0;

        /// <summary>
        /// Add a new key/value pair.
        /// </summary>
        /// <param name="key">The key</param>
        /// <param name="val">The value</param>
        /// <returns>A new map with the key/value added.</returns>
        virtual IAssociative *assoc(CjObject *key, CjObject *val) = 0;

    };
}
Q_DECLARE_INTERFACE(clojure_lang::IAssociative, "clojure.lang.IAssociative/1.0")


#endif
